package com.exp.bookhouse.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.exp.bookhouse.pojo.Book;
import com.exp.bookhouse.pojo.vo.BookVo;
import com.exp.bookhouse.pojo.vo.StockVo;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface BookService{

    //新增书籍
    int saveBook(Book book) throws Exception;

    //根据分类id分页查询书籍
    IPage<Book> queryBookByCategoryId(Integer pageNum, Integer pageSize, Integer categoryId);

    //查询所以书籍
    List<Book> queryAllBook();

    //根据id更新书籍信息
    int updateBookById(Book book);

    //根据书名模糊查询纾解列表，分页
    IPage<Book> queryBookByName(Integer pageNum, Integer pageSize, String name);

    //根据书名模糊查询列表，不分页
    public List<Book> getBookByName(String name);

    //根据id查询库存
    List<StockVo> queryStockById(List<BookVo> shopList);

    //分页查询书籍列表
    IPage<Book> queryBookByPage(Integer page, Integer size);

    //根据id查询书籍
    Book queryBookById(Long id);

    //更新书籍信息
    void updateBookById(String id, MultipartFile[] file) throws IOException;

    //删除指定书本的轮播图
    Book deleteImage(Long id, String url) throws Exception;

    //根据id删除书籍
    void deleteBook(Long id);
}
